using SheLife.Domain.Entities;

namespace SheLife.Application.Interfaces
{
    /// <summary>
    /// 护肤记录服务接口
    /// </summary>
    public interface ISkincareRecordService
    {
        /// <summary>
        /// 根据ID获取护肤记录
        /// </summary>
        /// <param name="id">护肤记录ID</param>
        /// <returns>护肤记录实体</returns>
        Task<SkincareRecord?> GetSkincareRecordByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取护肤记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>护肤记录列表</returns>
        Task<IEnumerable<SkincareRecord>> GetSkincareRecordsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和日期范围获取护肤记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>护肤记录列表</returns>
        Task<IEnumerable<SkincareRecord>> GetSkincareRecordsByUserIdAndDateRangeAsync(Guid userId, DateTime startDate, DateTime endDate);

        /// <summary>
        /// 根据用户ID和护肤类型获取护肤记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="skincareType">护肤类型</param>
        /// <returns>护肤记录列表</returns>
        Task<IEnumerable<SkincareRecord>> GetSkincareRecordsByUserIdAndSkincareTypeAsync(Guid userId, string skincareType);

        /// <summary>
        /// 创建护肤记录
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="date">日期</param>
        /// <param name="skincareType">护肤类型</param>
        /// <param name="description">描述</param>
        /// <param name="notes">备注</param>
        /// <returns>护肤记录实体</returns>
        Task<SkincareRecord> CreateSkincareRecordAsync(Guid userId, DateTime date, string skincareType, string description, string? notes = null);

        /// <summary>
        /// 更新护肤记录
        /// </summary>
        /// <param name="id">护肤记录ID</param>
        /// <param name="date">日期</param>
        /// <param name="skincareType">护肤类型</param>
        /// <param name="description">描述</param>
        /// <param name="notes">备注</param>
        /// <returns>护肤记录实体</returns>
        Task<SkincareRecord?> UpdateSkincareRecordAsync(Guid id, DateTime? date, string? skincareType, string? description, string? notes = null);

        /// <summary>
        /// 删除护肤记录
        /// </summary>
        /// <param name="id">护肤记录ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteSkincareRecordAsync(Guid id);

        /// <summary>
        /// 获取护肤统计数据
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="days">统计天数</param>
        /// <returns>统计数据字典</returns>
        Task<Dictionary<string, object>> GetSkincareStatisticsAsync(Guid userId, int days = 7);
    }

    /// <summary>
    /// 护肤产品服务接口
    /// </summary>
    public interface ISkincareProductService
    {
        /// <summary>
        /// 根据ID获取护肤产品
        /// </summary>
        /// <param name="id">护肤产品ID</param>
        /// <returns>护肤产品实体</returns>
        Task<SkincareProduct?> GetSkincareProductByIdAsync(Guid id);

        /// <summary>
        /// 获取所有护肤产品
        /// </summary>
        /// <returns>护肤产品列表</returns>
        Task<IEnumerable<SkincareProduct>> GetAllSkincareProductsAsync();

        /// <summary>
        /// 根据品牌获取护肤产品列表
        /// </summary>
        /// <param name="brand">品牌</param>
        /// <returns>护肤产品列表</returns>
        Task<IEnumerable<SkincareProduct>> GetSkincareProductsByBrandAsync(string brand);

        /// <summary>
        /// 根据分类获取护肤产品列表
        /// </summary>
        /// <param name="category">分类</param>
        /// <returns>护肤产品列表</returns>
        Task<IEnumerable<SkincareProduct>> GetSkincareProductsByCategoryAsync(string category);

        /// <summary>
        /// 搜索护肤产品
        /// </summary>
        /// <param name="keyword">关键词</param>
        /// <returns>护肤产品列表</returns>
        Task<IEnumerable<SkincareProduct>> SearchSkincareProductsAsync(string keyword);

        /// <summary>
        /// 创建护肤产品
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="brand">品牌</param>
        /// <param name="category">分类</param>
        /// <param name="description">描述</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>护肤产品实体</returns>
        Task<SkincareProduct> CreateSkincareProductAsync(string name, string brand, string category, string description, string? imageUrl = null);

        /// <summary>
        /// 更新护肤产品
        /// </summary>
        /// <param name="id">护肤产品ID</param>
        /// <param name="name">名称</param>
        /// <param name="brand">品牌</param>
        /// <param name="category">分类</param>
        /// <param name="description">描述</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>护肤产品实体</returns>
        Task<SkincareProduct?> UpdateSkincareProductAsync(Guid id, string? name, string? brand, string? category, string? description, string? imageUrl = null);

        /// <summary>
        /// 删除护肤产品
        /// </summary>
        /// <param name="id">护肤产品ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteSkincareProductAsync(Guid id);
    }

    /// <summary>
    /// 护肤产品记录服务接口
    /// </summary>
    public interface ISkincareProductRecordService
    {
        /// <summary>
        /// 根据ID获取护肤产品记录
        /// </summary>
        /// <param name="id">护肤产品记录ID</param>
        /// <returns>护肤产品记录实体</returns>
        Task<SkincareProductRecord?> GetSkincareProductRecordByIdAsync(Guid id);

        /// <summary>
        /// 根据护肤记录ID获取护肤产品记录列表
        /// </summary>
        /// <param name="skincareRecordId">护肤记录ID</param>
        /// <returns>护肤产品记录列表</returns>
        Task<IEnumerable<SkincareProductRecord>> GetSkincareProductRecordsBySkincareRecordIdAsync(Guid skincareRecordId);

        /// <summary>
        /// 根据用户ID和日期范围获取护肤产品记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>护肤产品记录列表</returns>
        Task<IEnumerable<SkincareProductRecord>> GetSkincareProductRecordsByUserIdAndDateRangeAsync(Guid userId, DateTime startDate, DateTime endDate);

        /// <summary>
        /// 创建护肤产品记录
        /// </summary>
        /// <param name="skincareRecordId">护肤记录ID</param>
        /// <param name="productId">产品ID</param>
        /// <param name="amount">用量</param>
        /// <returns>护肤产品记录实体</returns>
        Task<SkincareProductRecord> CreateSkincareProductRecordAsync(Guid skincareRecordId, Guid productId, decimal amount);

        /// <summary>
        /// 更新护肤产品记录
        /// </summary>
        /// <param name="id">护肤产品记录ID</param>
        /// <param name="amount">用量</param>
        /// <returns>护肤产品记录实体</returns>
        Task<SkincareProductRecord?> UpdateSkincareProductRecordAsync(Guid id, decimal? amount);

        /// <summary>
        /// 删除护肤产品记录
        /// </summary>
        /// <param name="id">护肤产品记录ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteSkincareProductRecordAsync(Guid id);
    }

    /// <summary>
    /// 用户护肤产品服务接口
    /// </summary>
    public interface IUserSkincareProductService
    {
        /// <summary>
        /// 根据ID获取用户护肤产品
        /// </summary>
        /// <param name="id">用户护肤产品ID</param>
        /// <returns>用户护肤产品实体</returns>
        Task<UserSkincareProduct?> GetUserSkincareProductByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取用户护肤产品列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>用户护肤产品列表</returns>
        Task<IEnumerable<UserSkincareProduct>> GetUserSkincareProductsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和产品ID获取用户护肤产品列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="productId">产品ID</param>
        /// <returns>用户护肤产品列表</returns>
        Task<IEnumerable<UserSkincareProduct>> GetUserSkincareProductsByUserIdAndProductIdAsync(Guid userId, Guid productId);

        /// <summary>
        /// 创建用户护肤产品
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="productId">产品ID</param>
        /// <param name="purchaseDate">购买日期</param>
        /// <param name="expiryDate">过期日期</param>
        /// <param name="notes">备注</param>
        /// <returns>用户护肤产品实体</returns>
        Task<UserSkincareProduct> CreateUserSkincareProductAsync(Guid userId, Guid productId, DateTime purchaseDate, DateTime? expiryDate = null, string? notes = null);

        /// <summary>
        /// 更新用户护肤产品
        /// </summary>
        /// <param name="id">用户护肤产品ID</param>
        /// <param name="purchaseDate">购买日期</param>
        /// <param name="expiryDate">过期日期</param>
        /// <param name="notes">备注</param>
        /// <returns>用户护肤产品实体</returns>
        Task<UserSkincareProduct?> UpdateUserSkincareProductAsync(Guid id, DateTime? purchaseDate, DateTime? expiryDate, string? notes);

        /// <summary>
        /// 删除用户护肤产品
        /// </summary>
        /// <param name="id">用户护肤产品ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteUserSkincareProductAsync(Guid id);

        /// <summary>
        /// 获取即将过期的用户护肤产品
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="days">天数</param>
        /// <returns>用户护肤产品列表</returns>
        Task<IEnumerable<UserSkincareProduct>> GetExpiringUserSkincareProductsAsync(Guid userId, int days = 30);
    }

    /// <summary>
    /// 护肤提醒服务接口
    /// </summary>
    public interface ISkincareReminderService
    {
        /// <summary>
        /// 根据ID获取护肤提醒
        /// </summary>
        /// <param name="id">护肤提醒ID</param>
        /// <returns>护肤提醒实体</returns>
        Task<SkincareReminder?> GetSkincareReminderByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取护肤提醒列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>护肤提醒列表</returns>
        Task<IEnumerable<SkincareReminder>> GetSkincareRemindersByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和启用状态获取护肤提醒列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="isEnabled">是否启用</param>
        /// <returns>护肤提醒列表</returns>
        Task<IEnumerable<SkincareReminder>> GetSkincareRemindersByUserIdAndIsEnabledAsync(Guid userId, bool isEnabled);

        /// <summary>
        /// 创建护肤提醒
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="reminderTime">提醒时间</param>
        /// <param name="repeatType">重复类型</param>
        /// <param name="repeatDays">重复天数</param>
        /// <returns>护肤提醒实体</returns>
        Task<SkincareReminder> CreateSkincareReminderAsync(Guid userId, string title, string description, TimeSpan reminderTime, string repeatType, List<int>? repeatDays = null);

        /// <summary>
        /// 更新护肤提醒
        /// </summary>
        /// <param name="id">护肤提醒ID</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="reminderTime">提醒时间</param>
        /// <param name="repeatType">重复类型</param>
        /// <param name="repeatDays">重复天数</param>
        /// <param name="isEnabled">是否启用</param>
        /// <returns>护肤提醒实体</returns>
        Task<SkincareReminder?> UpdateSkincareReminderAsync(Guid id, string? title, string? description, TimeSpan? reminderTime, string? repeatType, List<int>? repeatDays, bool? isEnabled);

        /// <summary>
        /// 删除护肤提醒
        /// </summary>
        /// <param name="id">护肤提醒ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteSkincareReminderAsync(Guid id);

        /// <summary>
        /// 启用护肤提醒
        /// </summary>
        /// <param name="id">护肤提醒ID</param>
        /// <returns>是否成功</returns>
        Task<bool> EnableSkincareReminderAsync(Guid id);

        /// <summary>
        /// 禁用护肤提醒
        /// </summary>
        /// <param name="id">护肤提醒ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DisableSkincareReminderAsync(Guid id);
    }

    /// <summary>
    /// 护肤计划服务接口
    /// </summary>
    public interface ISkincarePlanService
    {
        /// <summary>
        /// 根据ID获取护肤计划
        /// </summary>
        /// <param name="id">护肤计划ID</param>
        /// <returns>护肤计划实体</returns>
        Task<SkincarePlan?> GetSkincarePlanByIdAsync(Guid id);

        /// <summary>
        /// 获取所有护肤计划
        /// </summary>
        /// <returns>护肤计划列表</returns>
        Task<IEnumerable<SkincarePlan>> GetAllSkincarePlansAsync();

        /// <summary>
        /// 根据分类获取护肤计划列表
        /// </summary>
        /// <param name="category">分类</param>
        /// <returns>护肤计划列表</returns>
        Task<IEnumerable<SkincarePlan>> GetSkincarePlansByCategoryAsync(string category);

        /// <summary>
        /// 根据肤质获取护肤计划列表
        /// </summary>
        /// <param name="skinType">肤质</param>
        /// <returns>护肤计划列表</returns>
        Task<IEnumerable<SkincarePlan>> GetSkincarePlansBySkinTypeAsync(string skinType);

        /// <summary>
        /// 搜索护肤计划
        /// </summary>
        /// <param name="keyword">关键词</param>
        /// <returns>护肤计划列表</returns>
        Task<IEnumerable<SkincarePlan>> SearchSkincarePlansAsync(string keyword);

        /// <summary>
        /// 创建护肤计划
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="skinType">肤质</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>护肤计划实体</returns>
        Task<SkincarePlan> CreateSkincarePlanAsync(string name, string description, string category, string skinType, string? imageUrl = null);

        /// <summary>
        /// 更新护肤计划
        /// </summary>
        /// <param name="id">护肤计划ID</param>
        /// <param name="name">名称</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="skinType">肤质</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>护肤计划实体</returns>
        Task<SkincarePlan?> UpdateSkincarePlanAsync(Guid id, string? name, string? description, string? category, string? skinType, string? imageUrl = null);

        /// <summary>
        /// 删除护肤计划
        /// </summary>
        /// <param name="id">护肤计划ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteSkincarePlanAsync(Guid id);
    }

    /// <summary>
    /// 护肤计划步骤服务接口
    /// </summary>
    public interface ISkincarePlanStepService
    {
        /// <summary>
        /// 根据ID获取护肤计划步骤
        /// </summary>
        /// <param name="id">护肤计划步骤ID</param>
        /// <returns>护肤计划步骤实体</returns>
        Task<SkincarePlanStep?> GetSkincarePlanStepByIdAsync(Guid id);

        /// <summary>
        /// 根据护肤计划ID获取护肤计划步骤列表
        /// </summary>
        /// <param name="planId">护肤计划ID</param>
        /// <returns>护肤计划步骤列表</returns>
        Task<IEnumerable<SkincarePlanStep>> GetSkincarePlanStepsByPlanIdAsync(Guid planId);

        /// <summary>
        /// 创建护肤计划步骤
        /// </summary>
        /// <param name="planId">护肤计划ID</param>
        /// <param name="stepNumber">步骤编号</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="timeOfDay">时间点</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>护肤计划步骤实体</returns>
        Task<SkincarePlanStep> CreateSkincarePlanStepAsync(Guid planId, int stepNumber, string title, string description, string timeOfDay, string? imageUrl = null);

        /// <summary>
        /// 更新护肤计划步骤
        /// </summary>
        /// <param name="id">护肤计划步骤ID</param>
        /// <param name="stepNumber">步骤编号</param>
        /// <param name="title">标题</param>
        /// <param name="description">描述</param>
        /// <param name="timeOfDay">时间点</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>护肤计划步骤实体</returns>
        Task<SkincarePlanStep?> UpdateSkincarePlanStepAsync(Guid id, int? stepNumber, string? title, string? description, string? timeOfDay, string? imageUrl = null);

        /// <summary>
        /// 删除护肤计划步骤
        /// </summary>
        /// <param name="id">护肤计划步骤ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteSkincarePlanStepAsync(Guid id);
    }

    /// <summary>
    /// 用户护肤计划服务接口
    /// </summary>
    public interface IUserSkincarePlanService
    {
        /// <summary>
        /// 根据ID获取用户护肤计划
        /// </summary>
        /// <param name="id">用户护肤计划ID</param>
        /// <returns>用户护肤计划实体</returns>
        Task<UserSkincarePlan?> GetUserSkincarePlanByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取用户护肤计划列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>用户护肤计划列表</returns>
        Task<IEnumerable<UserSkincarePlan>> GetUserSkincarePlansByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和计划ID获取用户护肤计划列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="planId">计划ID</param>
        /// <returns>用户护肤计划列表</returns>
        Task<IEnumerable<UserSkincarePlan>> GetUserSkincarePlansByUserIdAndPlanIdAsync(Guid userId, Guid planId);

        /// <summary>
        /// 创建用户护肤计划
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="planId">计划ID</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="notes">备注</param>
        /// <returns>用户护肤计划实体</returns>
        Task<UserSkincarePlan> CreateUserSkincarePlanAsync(Guid userId, Guid planId, DateTime startDate, string? notes = null);

        /// <summary>
        /// 更新用户护肤计划
        /// </summary>
        /// <param name="id">用户护肤计划ID</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <param name="notes">备注</param>
        /// <returns>用户护肤计划实体</returns>
        Task<UserSkincarePlan?> UpdateUserSkincarePlanAsync(Guid id, DateTime? startDate, DateTime? endDate, string? notes);

        /// <summary>
        /// 删除用户护肤计划
        /// </summary>
        /// <param name="id">用户护肤计划ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteUserSkincarePlanAsync(Guid id);

        /// <summary>
        /// 完成用户护肤计划
        /// </summary>
        /// <param name="id">用户护肤计划ID</param>
        /// <returns>是否成功</returns>
        Task<bool> CompleteUserSkincarePlanAsync(Guid id);
    }
}